home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Math::BigFloat.Z / Math::BigFloat
Encoding:
Text File  |  1998-10-28  |  2.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Math::BigFloat - Arbitrary length float math package
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.         use    Math::BigFloat;
  13.         $f = Math::BigFloat->new($string);
  14.  
  15.         $f->fadd(NSTR) return NSTR          addition
  16.         $f->fsub(NSTR) return NSTR          subtraction
  17.         $f->fmul(NSTR) return NSTR          multiplication
  18.         $f->fdiv(NSTR[,SCALE]) returns NSTR      division to SCALE places
  19.         $f->fneg() return NSTR          negation
  20.         $f->fabs() return NSTR          absolute value
  21.         $f->fcmp(NSTR) return CODE          compare undef,<0,=0,>0
  22.         $f->fround(SCALE) return NSTR      round    to SCALE digits
  23.         $f->ffround(SCALE) return NSTR      round    at SCALEth place
  24.         $f->fnorm()    return (NSTR)          normalize
  25.         $f->fsqrt([SCALE]) return NSTR      sqrt to SCALE    places
  26.  
  27.  
  28.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.       All basic math operations are    overloaded if you declare your
  30.       big floats as
  31.  
  32.           $float = new Math::BigFloat "2.123123123123123123123123123123123";
  33.  
  34.  
  35.       number format
  36.         canonical strings have the form /[+-]\d+E[+-]\d+/ .     Input
  37.         values can have inbedded whitespace.
  38.  
  39.       Error    returns    'NaN'
  40.         An input parameter was "Not    a Number" or divide by zero or
  41.         sqrt of negative number.
  42.  
  43.       Division is computed to
  44.         max($div_scale,length(dividend)+length(divisor)) digits by
  45.         default.  Also used    for default sqrt scale.
  46.  
  47.      BBBBUUUUGGGGSSSS
  48.       The current version of this module is    a preliminary version
  49.       of the real thing that is currently (as of perl5.002)    under
  50.       development.
  51.  
  52.      AAAAUUUUTTTTHHHHOOOORRRR
  53.       Mark Biggar
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.      Page 2                        (printed 10/23/98)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.